package com.gnerv.battle.boot.module.base.model.dto;

import com.gnerv.battle.boot.module.base.model.bo.RoleBO;
import com.gnerv.battle.boot.module.base.model.bo.RoleDatePermissionBO;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Set;

/**
 * @author Gnerv LiGen
 */
@Data
public class RoleCreateDTO {

    private String name;
    private String description;
    private Set<String> roleUkIdList;
    private Set<String> orgUkIdList;
    private String status;
    private Integer sort;

    public RoleBO toRoleBO() {
        RoleBO roleBO = new RoleBO();
        BeanUtils.copyProperties(this, roleBO);
        return roleBO;
    }

    public RoleDatePermissionBO toRoleDatePermissionBO(){
        RoleDatePermissionBO roleDatePermissionBO = new RoleDatePermissionBO();
        roleDatePermissionBO.setRoleUkIdList(roleUkIdList);
        roleDatePermissionBO.setOrgUkIdList(orgUkIdList);
        return roleDatePermissionBO;
    }
}